all:
	make -C common/commonlib
	make -C common/commonlib install
	make -C common/descriptorManager
	make -C common/plugin_helper 
	make -C common/unitReader
	make -C indexer/unitResource
	make -C indexer/resource_processor
	make -C indexer/common
	make -C indexer/tools
	make -C indexer/merger
	make -C indexer/inverter
	make -C indexer/divider
	make -C indexer/display_gen
	make -C indexer/unit_gen
	make -C search/

clean:
	make -C common/commonlib clean
	make -C common/descriptorManager clean
	make -C common/unitReader clean
	make -C common/plugin_helper clean
	make -C indexer/resource_processor clean
	make -C indexer/tools clean
	make -C indexer/common clean
	make -C indexer/merger clean
	make -C indexer/inverter clean
	make -C indexer/divider clean
	make -C indexer/display_gen clean
	make -C indexer/unit_gen clean
	make -C indexer/unitResource clean
	make -C search/ clean

install:
	cp indexer/resource_processor/forwarder release/indexer/bin/
	cp indexer/inverter/inverter  release/indexer/bin/
	cp indexer/merger/merger  release/indexer/bin/
	cp indexer/divider/divider  release/indexer/bin/
	cp indexer/display_gen/displayGen  release/indexer/bin/
	cp indexer/unit_gen/unitGen  release/indexer/bin/
	cp indexer/tools/termlistreader release/indexer/tools/
	cp indexer/tools/displayreader release/indexer/tools/
	cp indexer/tools/idxreader release/indexer/tools/
	cp indexer/tools/idx1reader release/indexer/tools/
	cp indexer/tools/idx0reader release/indexer/tools/
	cp indexer/tools/idxcheck release/indexer/tools/
	cp indexer/tools/idx0check release/indexer/tools/
	cp indexer/tools/idx1check release/indexer/tools/
	cp indexer/tools/unitChecker release/indexer/tools/
	cp common/unitReader/unitReaderChecker release/indexer/tools/
	scp indexer/merger/merger img@bb-apptest-img05.vm:fastsearch/indexer/bin/
	scp indexer/tools/idxreader img@bb-apptest-img05.vm:fastsearch/indexer/tools/
	scp indexer/tools/idxcheck  img@bb-apptest-img05.vm:fastsearch/indexer/tools/
	scp indexer/tools/idx0check img@bb-apptest-img05.vm:fastsearch/indexer/tools/
	scp indexer/tools/idx1check img@bb-apptest-img05.vm:fastsearch/indexer/tools/

	#scp indexer/resource_processor/forwarder img@bb-apptest-img05.vm:fastsearch/indexer/bin/
#	scp indexer/inverter/inverter img@bb-apptest-img05.vm:fastsearch/indexer/bin/
#	scp indexer/divider/divider img@bb-apptest-img05.vm:fastsearch/indexer/bin/
#	scp indexer/display_gen/displayGen img@bb-apptest-img05.vm:fastsearch/indexer/bin/
	
	

test:
	#build idx
	cd release/indexer/ && sh bin/clean.sh && sh bin/build.sh && cd -
	cd release/indexer/ && sh tools/run_check.sh
